package com.hxh.demo;

import com.hxh.model.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/6/23 16:28
 */
@Controller
public class StudentBeans {

    @Bean(name = {"s1", "s2"})
    public Student student() {
        Student student = new Student();
        student.setId(1);
        student.setName("黄小黄");
        student.setAge(17);
        return student;
    }

    @Bean
    public Student student02() {
        Student student = new Student();
        student.setId(2);
        student.setName("蒲小七");
        student.setAge(16);
        return student;
    }
}
